/**
 * Copyright (c) 2017 ShopJsp. All Rights Reserved.
 * ============================================================================
 * 版权所有 2011 - 今 北京华宇盈通科技有限公司，并保留所有权利。
 * ----------------------------------------------------------------------------
 * 提示：在未取得SHOPJSP商业授权之前，您不能将本软件应用于商业用途，否则SHOPJSP将保留追究的权力。
 * ----------------------------------------------------------------------------
 * 官方网站：http://www.shopjsp.com
 * ============================================================================
 */
package com.hyyt.shopjsp.product.service.imp;

import com.hyyt.shopjsp.product.dao.ShopProductInfoDetailDAO;
import com.hyyt.shopjsp.product.pojo.ShopProductInfoDetail;
import com.hyyt.shopjsp.product.service.IShopProductInfoDetailService;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * SHOP_商品详情表
 *
 * @author Robot 2017-03-29 15:21:35
 */

@Service
public class ShopProductInfoDetailService implements IShopProductInfoDetailService {
    private static  final Logger logger = Logger.getLogger(IShopProductInfoDetailService.class);

    @Resource
    private ShopProductInfoDetailDAO shopProductInfoDetailDAO;

    /**
     * 保存SHOP_商品详情表
     *
     * @param shopProductInfoDetail SHOP_商品详情表
     * @return 保存后的SHOP_商品详情表
     */
    @Override
    public void saveShopProductInfoDetail(ShopProductInfoDetail shopProductInfoDetail) {
        shopProductInfoDetailDAO.insert(shopProductInfoDetail);
    }

    /**
     * 更新SHOP_商品详情表
     *
     * @param shopProductInfoDetail SHOP_商品详情表
     * @return 更新后的SHOP_商品详情表
     */
    @Override
    public void updateShopProductInfoDetail(ShopProductInfoDetail shopProductInfoDetail) {
        shopProductInfoDetailDAO.update(shopProductInfoDetail);
    }

    /**
     * 删除指定ID的SHOP_商品详情表
     *
     * @param id SHOP_商品详情表ID
     */
    @Override
    public void deleteShopProductInfoDetail(Integer id) {
        shopProductInfoDetailDAO.delete(id);
    }

    /**
     * 删除指定ID集合的SHOP_商品详情表
     *
     * @param ids SHOP_商品详情表ID集合
    */
    public void deleteShopProductInfoDetail(Collection<Integer> ids){
        shopProductInfoDetailDAO.batchDelete(ids);
    }

    /**
     * 根据ID加载一个SHOP_商品详情表
     *
     * @param id SHOP_商品详情表ID
     * @return SHOP_商品详情表
     */
    @Override
    public ShopProductInfoDetail loadShopProductInfoDetail(Integer id) {
        return shopProductInfoDetailDAO.load(id);
    }

    /**
    * 查询所有的SHOP_商品详情表，通常有最多取30000条记录的限制
    *
    * @return 所有的SHOP_商品详情表，通常有最多取30000条记录的限制
    */
    @Override
    public List<ShopProductInfoDetail> queryAllShopProductInfoDetail() {
        return shopProductInfoDetailDAO.queryAll();
    }

    /**
     * 查询SHOP_商品详情表
     *
     * @param params 查询参数，为key-value形式
     * @return SHOP_商品详情表集合
     */
    @Override
    public List<ShopProductInfoDetail> queryShopProductInfoDetail(Map<String, Object> params) {
        return shopProductInfoDetailDAO.query(params);
    }

    /**
     * 查询SHOP_商品详情表
     *
     * @param params   查询参数，没有则传null,分页参数key为“sortColumns”
     * @param startRow 起始行数（不含起始行的数据）
     * @param rowSize  要查询记录数
     * @return SHOP_商品详情表集合
     */
    @Override
    public List<ShopProductInfoDetail> queryShopProductInfoDetail(Map<String, Object> params, int startRow, int rowSize) {
        return shopProductInfoDetailDAO.query(params, startRow, rowSize);
    }

    /**
     * 统计SHOP_商品详情表
     *
     * @param params 查询参数，没有则传null,分页参数key为“sortColumns”
     * @return 结果集记录数
     */
    @Override
    public int countShopProductInfoDetail(Map<String, Object> params) {
        return shopProductInfoDetailDAO.count(params);
    }
}